# coding=utf-8
# todo 栈 先入后出
class Stack(object):
    def __init__(self):
        self.__list = list()

    def is_empty(self):
        return self.__list == []

    def size(self):
        return len(self.__list)

    def push(self, item):  # 添加元素到栈顶
        self.__list.append(item)

    def pop(self):  # 弹出栈顶元素
        if self.is_empty():
            return None
        return self.__list.pop()

    def peak(self):  # 返回栈顶元素
        if self.is_empty():
            return None
        return self.__list[self.size() - 1]
